//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/.
// 			VisualNovelToolkit		     /_/_/_/_/_/_/_/_/_/.
// Copyright ©2013 - Sol-tribe.	/_/_/_/_/_/_/_/_/_/.
//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

/// <summary>
/// Function node is the base class of ScenarioNode.
/// </summary>
public class FunctionNode : BaseNode {	
	/// <summary>
	/// To Scenario Script.
	/// </summary>
	/// <param name='sb'>
	/// Sb.
	/// </param>
	public override void ToScenarioScript( ref System.Text.StringBuilder sb ){
		sb.Append( "*" + name + System.Environment.NewLine );		
	}
	
	public override void ToByteCode( ByteCodes code  ){
		ToByteCodeInternal( code );	
	}

#if false
	[ System.ObsoleteAttribute ]
	protected void AddFuncCode( ByteCodes code ){
		int funcPos = code.AddStartOfFunction( name );				
		
		// If using AlreadyCompiledCode , Compiled Byte Code TextAsset will be Loaded  .
		if( useAlreadyCompiledCode ){			
			if( m_CompiledInternalCodeAsset != null ){
				code.Add( m_CompiledInternalCodeAsset.bytes );		// Add Internal Code.
			}					
		}
		else{						
			ToByteCodeInternal( code );
		}
		
		code.AddEndOfFunction( funcPos );
	}	
#endif	
}
